home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 November / Macworld (1999-11).dmg / Updaters / WhiteCap 3.0.4 / WhiteCap Source.sit / WhiteCap Source / Common / General Tools / Headers / XPtrList.h < prev    next >
MacBinary  |  1999-07-13  |  4.6 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Jul 13 21:53:56 1999, modified Tue Jul 13 21:53:56 1999, creator 'CWIE', type ASCII, 4095 bytes "XPtrList.h" , at 0x107f 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 58 50 74 72 4c 69 | 73 74 2e 68 00 00 00 00 |..XPtrLi|st.h....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 0f ff 00 | 00 01 9a b3 b1 9e 34 b3 |........|......4.|
|00000060| b1 9e 34 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..4.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 e5 0e 00 00 |........|........|
|00000080| 23 69 66 6e 64 65 66 20 | 5f 58 50 54 52 4c 49 53 |#ifndef |_XPTRLIS|
|00000090| 54 5f 0d 23 64 65 66 69 | 6e 65 20 5f 58 50 54 52 |T_.#defi|ne _XPTR|
|000000a0| 4c 49 53 54 5f 0d 0d 2f | 2f 20 42 79 20 41 6e 64 |LIST_../|/ By And|
|000000b0| 72 65 77 20 4f 27 4d 65 | 61 72 61 0d 0d 23 69 6e |rew O'Me|ara..#in|
|000000c0| 63 6c 75 64 65 20 22 55 | 74 69 6c 53 74 72 2e 68 |clude "U|tilStr.h|
|000000d0| 22 0d 0d 2f 2f 20 50 6f | 73 74 3a 09 52 65 74 75 |"..// Po|st:.Retu|
|000000e0| 72 6e 73 20 61 20 6e 75 | 6d 20 3e 3d 20 30 20 69 |rns a nu|m >= 0 i|
|000000f0| 66 66 20 74 68 65 20 66 | 69 72 73 74 20 61 72 67 |ff the f|irst arg|
|00000100| 20 69 73 20 6c 65 73 73 | 20 74 68 61 6e 20 6f 72 | is less| than or|
|00000110| 20 65 71 75 61 6c 20 74 | 6f 20 74 68 65 20 73 65 | equal t|o the se|
|00000120| 63 6f 6e 64 20 61 72 67 | 2e 0d 2f 2f 09 09 09 52 |cond arg|..//...R|
|00000130| 65 74 75 72 6e 73 20 61 | 20 6e 75 6d 20 3c 20 30 |eturns a| num < 0|
|00000140| 20 69 66 66 20 74 68 65 | 20 66 69 72 73 74 20 61 | iff the| first a|
|00000150| 72 67 20 69 73 20 67 72 | 65 61 74 65 72 20 74 68 |rg is gr|eater th|
|00000160| 61 6e 20 74 68 65 20 73 | 65 63 6f 6e 64 20 61 72 |an the s|econd ar|
|00000170| 67 2e 0d 74 79 70 65 64 | 65 66 20 69 6e 74 20 28 |g..typed|ef int (|
|00000180| 2a 43 6f 6d 70 46 75 6e | 63 74 69 6f 6e 54 29 28 |*CompFun|ctionT)(|
|00000190| 63 6f 6e 73 74 20 76 6f | 69 64 2a 2c 20 63 6f 6e |const vo|id*, con|
|000001a0| 73 74 20 76 6f 69 64 2a | 29 3b 0d 0d 0d 65 6e 75 |st void*|);...enu|
|000001b0| 6d 20 4c 69 73 74 4f 72 | 64 65 72 69 6e 67 54 20 |m ListOr|deringT |
|000001c0| 7b 0d 09 63 4f 72 64 65 | 72 49 6d 70 6f 72 74 61 |{..cOrde|rImporta|
|000001d0| 6e 74 2c 0d 09 63 4f 72 | 64 65 72 4e 6f 74 49 6d |nt,..cOr|derNotIm|
|000001e0| 70 6f 72 74 61 6e 74 2c | 0d 09 63 53 6f 72 74 4c |portant,|..cSortL|
|000001f0| 6f 77 54 6f 48 69 67 68 | 2c 0d 09 63 53 6f 72 74 |owToHigh|,..cSort|
|00000200| 48 69 67 68 54 6f 4c 6f | 77 0d 7d 3b 0d 0d 63 6c |HighToLo|w.};..cl|
|00000210| 61 73 73 20 58 50 74 72 | 4c 69 73 74 20 3a 20 70 |ass XPtr|List : p|
|00000220| 72 6f 74 65 63 74 65 64 | 20 55 74 69 6c 53 74 72 |rotected| UtilStr|
|00000230| 20 7b 0d 0d 09 09 66 72 | 69 65 6e 64 20 63 6c 61 | {....fr|iend cla|
|00000240| 73 73 20 58 50 74 72 4c | 69 73 74 3b 0d 09 09 66 |ss XPtrL|ist;...f|
|00000250| 72 69 65 6e 64 20 63 6c | 61 73 73 20 58 53 74 72 |riend cl|ass XStr|
|00000260| 4c 69 73 74 3b 0d 09 09 | 66 72 69 65 6e 64 20 63 |List;...|friend c|
|00000270| 6c 61 73 73 20 58 44 69 | 63 74 69 6f 6e 61 72 79 |lass XDi|ctionary|
|00000280| 3b 0d 09 09 66 72 69 65 | 6e 64 20 63 6c 61 73 73 |;...frie|nd class|
|00000290| 20 48 61 73 68 74 61 62 | 6c 65 3b 0d 09 09 66 72 | Hashtab|le;...fr|
|000002a0| 69 65 6e 64 20 63 6c 61 | 73 73 20 58 46 6c 6f 61 |iend cla|ss XFloa|
|000002b0| 74 4c 69 73 74 3b 0d 09 | 09 66 72 69 65 6e 64 20 |tList;..|.friend |
|000002c0| 63 6c 61 73 73 20 58 4c | 6f 6e 67 4c 69 73 74 3b |class XL|ongList;|
|000002d0| 0d 09 0d 09 70 75 62 6c | 69 63 3a 0d 09 09 09 09 |....publ|ic:.....|
|000002e0| 09 09 09 09 58 50 74 72 | 4c 69 73 74 28 20 63 6f |....XPtr|List( co|
|000002f0| 6e 73 74 20 58 50 74 72 | 4c 69 73 74 26 20 69 6e |nst XPtr|List& in|
|00000300| 4c 69 73 74 20 29 3b 0d | 09 09 09 09 09 09 09 09 |List );.|........|
|00000310| 58 50 74 72 4c 69 73 74 | 28 20 4c 69 73 74 4f 72 |XPtrList|( ListOr|
|00000320| 64 65 72 69 6e 67 54 20 | 69 6e 4f 72 64 65 72 69 |deringT |inOrderi|
|00000330| 6e 67 20 3d 20 63 4f 72 | 64 65 72 4e 6f 74 49 6d |ng = cOr|derNotIm|
|00000340| 70 6f 72 74 61 6e 74 20 | 29 3b 0d 09 09 09 09 09 |portant |);......|
|00000350| 09 09 09 0d 09 09 2f 2f | 09 50 6f 73 74 3a 09 41 |......//|.Post:.A|
|00000360| 73 73 69 67 6e 73 20 74 | 68 69 73 20 66 72 6f 6d |ssigns t|his from|
|00000370| 20 3c 69 6e 4c 69 73 74 | 3e 2e 0d 09 09 76 6f 69 | <inList|>....voi|
|00000380| 64 09 09 09 09 09 41 73 | 73 69 67 6e 28 20 63 6f |d.....As|sign( co|
|00000390| 6e 73 74 20 58 50 74 72 | 4c 69 73 74 26 20 69 6e |nst XPtr|List& in|
|000003a0| 4c 69 73 74 20 29 3b 0d | 09 09 0d 09 09 2f 2f 09 |List );.|.....//.|
|000003b0| 50 6f 73 74 3a 09 41 64 | 64 73 20 74 68 65 20 70 |Post:.Ad|ds the p|
|000003c0| 74 72 20 74 6f 20 74 68 | 69 73 27 20 6c 69 73 74 |tr to th|is' list|
|000003d0| 0d 09 09 2f 2f 09 4f 72 | 64 65 72 3a 09 4f 28 20 |...//.Or|der:.O( |
|000003e0| 31 20 29 2c 20 4f 28 20 | 6c 6f 67 20 6e 20 29 20 |1 ), O( |log n ) |
|000003f0| 69 66 20 73 6f 72 74 69 | 6e 67 20 69 73 20 6f 6e |if sorti|ng is on|
|00000400| 2e 0d 09 09 2f 2f 09 4e | 6f 74 65 3a 09 52 65 74 |....//.N|ote:.Ret|
|00000410| 75 72 6e 73 20 77 68 61 | 74 20 69 6e 64 65 78 20 |urns wha|t index |
|00000420| 74 68 65 20 6e 65 77 20 | 65 6c 65 6d 65 6e 74 20 |the new |element |
|00000430| 6f 63 63 75 70 69 65 73 | 20 28 31 2d 62 61 73 65 |occupies| (1-base|
|00000440| 64 20 69 6e 64 65 78 69 | 6e 67 29 2e 0d 09 09 6c |d indexi|ng)....l|
|00000450| 6f 6e 67 09 09 09 09 09 | 41 64 64 28 20 63 6f 6e |ong.....|Add( con|
|00000460| 73 74 20 76 6f 69 64 2a | 20 69 6e 50 74 72 54 6f |st void*| inPtrTo|
|00000470| 41 64 64 20 29 3b 0d 09 | 09 0d 09 09 2f 2f 09 50 |Add );..|....//.P|
|00000480| 6f 73 74 3a 09 41 64 64 | 73 20 74 68 65 20 70 74 |ost:.Add|s the pt|
|00000490| 72 20 74 6f 20 74 68 69 | 73 27 20 6c 69 73 74 20 |r to thi|s' list |
|000004a0| 61 66 74 65 72 20 28 65 | 78 69 73 74 69 6e 67 29 |after (e|xisting)|
|000004b0| 20 70 74 72 20 6e 75 6d | 62 65 72 20 69 6e 4e 2d | ptr num|ber inN-|
|000004c0| 2d 6d 61 6b 65 20 69 6e | 4e 20 30 20 69 66 20 79 |-make in|N 0 if y|
|000004d0| 6f 75 20 77 61 6e 74 20 | 79 6f 75 72 20 70 74 72 |ou want |your ptr|
|000004e0| 20 74 6f 20 62 65 20 74 | 68 65 20 31 73 74 20 65 | to be t|he 1st e|
|000004f0| 6c 65 6d 65 6e 74 0d 09 | 09 2f 2f 09 4f 72 64 65 |lement..|.//.Orde|
|00000500| 72 3a 09 4f 28 20 31 20 | 29 0d 09 09 2f 2f 09 4e |r:.O( 1 |)...//.N|
|00000510| 6f 74 65 3a 09 49 66 20 | 69 6e 4e 20 69 73 20 69 |ote:.If |inN is i|
|00000520| 6e 76 61 6c 69 64 2c 20 | 74 68 65 20 63 6c 6f 73 |nvalid, |the clos|
|00000530| 65 73 74 20 65 6c 65 6d | 65 6e 74 20 69 73 20 75 |est elem|ent is u|
|00000540| 73 65 64 0d 09 09 76 6f | 69 64 09 09 09 09 09 41 |sed...vo|id.....A|
|00000550| 64 64 28 20 63 6f 6e 73 | 74 20 76 6f 69 64 2a 20 |dd( cons|t void* |
|00000560| 69 6e 50 74 72 54 6f 41 | 64 64 2c 20 6c 6f 6e 67 |inPtrToA|dd, long|
|00000570| 20 69 6e 4e 20 29 3b 0d | 09 09 0d 09 09 2f 2f 09 | inN );.|.....//.|
|00000580| 50 6f 73 74 3a 09 41 64 | 64 73 20 65 61 63 68 20 |Post:.Ad|ds each |
|00000590| 65 6c 65 6d 65 6e 74 20 | 6f 66 20 74 68 65 20 69 |element |of the i|
|000005a0| 6e 63 6f 6d 69 6e 67 20 | 6c 69 73 74 20 74 6f 20 |ncoming |list to |
|000005b0| 74 68 69 73 20 6c 69 73 | 74 2e 20 20 54 68 69 73 |this lis|t. This|
|000005c0| 20 69 73 20 66 75 6e 63 | 74 69 6f 6e 61 6c 6c 79 | is func|tionally|
|000005d0| 20 74 68 65 20 73 61 6d | 65 20 61 73 0d 09 09 2f | the sam|e as.../|
|000005e0| 2f 09 09 09 6c 6f 6f 70 | 69 6e 67 20 74 68 72 75 |/...loop|ing thru|
|000005f0| 20 74 68 65 20 73 69 7a | 65 20 6f 66 20 69 6e 50 | the siz|e of inP|
|00000600| 74 72 4c 69 73 74 20 61 | 6e 64 20 63 61 6c 6c 69 |trList a|nd calli|
|00000610| 6e 67 20 74 68 69 73 2e | 41 64 64 28 29 20 66 6f |ng this.|Add() fo|
|00000620| 72 20 65 61 63 68 20 65 | 6c 65 6d 65 6e 74 2e 0d |r each e|lement..|
|00000630| 09 09 76 6f 69 64 09 09 | 09 09 09 41 64 64 28 20 |..void..|...Add( |
|00000640| 63 6f 6e 73 74 20 58 50 | 74 72 4c 69 73 74 26 20 |const XP|trList& |
|00000650| 69 6e 50 74 72 4c 69 73 | 74 20 29 3b 0d 09 09 0d |inPtrLis|t );....|
|00000660| 09 09 2f 2f 09 50 6f 73 | 74 3a 09 53 65 61 72 63 |..//.Pos|t:.Searc|
|00000670| 68 65 73 20 66 6f 72 20 | 74 68 65 20 70 74 72 20 |hes for |the ptr |
|00000680| 69 6e 20 74 68 65 20 6c | 69 73 74 20 61 6e 64 20 |in the l|ist and |
|00000690| 72 65 6d 6f 76 65 73 20 | 69 74 20 69 66 20 66 6f |removes |it if fo|
|000006a0| 75 6e 64 2e 0d 09 09 2f | 2f 09 4e 6f 74 65 3a 09 |und..../|/.Note:.|
|000006b0| 3c 74 72 75 65 3e 20 69 | 73 20 72 65 74 75 72 6e |<true> i|s return|
|000006c0| 65 64 20 69 66 20 74 68 | 65 20 70 74 72 20 77 61 |ed if th|e ptr wa|
|000006d0| 73 20 66 6f 75 6e 64 20 | 28 61 6e 64 20 72 65 6d |s found |(and rem|
|000006e0| 6f 76 65 64 29 0d 09 09 | 2f 2f 09 4f 72 64 65 72 |oved)...|//.Order|
|000006f0| 3a 09 4f 28 20 4e 20 29 | 2c 20 4f 28 20 6c 6f 67 |:.O( N )|, O( log|
|00000700| 20 6e 20 2b 20 61 6c 70 | 68 61 20 6e 20 29 20 69 | n + alp|ha n ) i|
|00000710| 66 20 73 6f 72 74 69 6e | 67 20 69 73 20 6f 6e 2e |f sortin|g is on.|
|00000720| 0d 09 09 62 6f 6f 6c 09 | 09 09 09 09 52 65 6d 6f |...bool.|....Remo|
|00000730| 76 65 28 20 63 6f 6e 73 | 74 20 76 6f 69 64 2a 20 |ve( cons|t void* |
|00000740| 69 6e 50 74 72 54 6f 52 | 65 6d 6f 76 65 20 29 3b |inPtrToR|emove );|
|00000750| 0d 0d 09 09 2f 2f 09 4e | 6f 74 65 3a 09 3c 74 72 |....//.N|ote:.<tr|
|00000760| 75 65 3e 20 69 73 20 72 | 65 74 75 72 6e 65 64 20 |ue> is r|eturned |
|00000770| 69 66 20 74 68 65 20 65 | 6c 65 6d 65 6e 74 20 77 |if the e|lement w|
|00000780| 61 73 20 66 6f 75 6e 64 | 20 28 61 6e 64 20 72 65 |as found| (and re|
|00000790| 6d 6f 76 65 64 29 0d 09 | 09 2f 2f 09 4f 72 64 65 |moved)..|.//.Orde|
|000007a0| 72 3a 09 4f 28 20 4e 20 | 29 2c 20 4f 28 20 6c 6f |r:.O( N |), O( lo|
|000007b0| 67 20 6e 20 29 20 69 66 | 20 73 6f 72 74 69 6e 67 |g n ) if| sorting|
|000007c0| 20 69 73 20 6f 6e 2e 0d | 09 09 2f 2f 09 4e 6f 74 | is on..|..//.Not|
|000007d0| 65 3a 09 57 68 65 6e 20 | 6f 72 64 65 72 20 69 73 |e:.When |order is|
|000007e0| 20 73 65 74 20 74 6f 20 | 62 65 20 70 72 65 73 65 | set to |be prese|
|000007f0| 72 76 65 64 20 28 76 69 | 61 20 63 4f 72 64 65 72 |rved (vi|a cOrder|
|00000800| 49 6d 70 6f 72 74 61 6e | 74 20 6f 72 20 61 20 73 |Importan|t or a s|
|00000810| 70 65 63 69 66 69 63 65 | 64 20 73 6f 72 74 20 66 |pecifice|d sort f|
|00000820| 63 6e 29 2c 20 65 6c 65 | 6d 65 6e 74 73 0d 09 09 |cn), ele|ments...|
|00000830| 2f 2f 09 09 09 61 74 20 | 74 68 65 20 65 6e 64 20 |//...at |the end |
|00000840| 6f 66 20 74 68 65 20 6c | 69 73 74 20 61 72 65 20 |of the l|ist are |
|00000850| 72 65 6d 6f 76 65 64 20 | 66 61 73 74 65 72 0d 09 |removed |faster..|
|00000860| 09 62 6f 6f 6c 09 09 09 | 09 09 52 65 6d 6f 76 65 |.bool...|..Remove|
|00000870| 45 6c 65 6d 65 6e 74 28 | 20 6c 6f 6e 67 20 69 6e |Element(| long in|
|00000880| 49 6e 64 65 78 20 29 3b | 0d 09 09 62 6f 6f 6c 09 |Index );|...bool.|
|00000890| 09 09 09 09 52 65 6d 6f | 76 65 4c 61 73 74 28 29 |....Remo|veLast()|
|000008a0| 3b 0d 09 09 0d 09 09 2f | 2f 09 50 6f 73 74 3a 09 |;....../|/.Post:.|
|000008b0| 45 6d 70 74 69 65 73 20 | 74 68 65 20 70 74 72 20 |Empties |the ptr |
|000008c0| 6c 69 73 74 0d 09 09 76 | 6f 69 64 09 09 09 09 09 |list...v|oid.....|
|000008d0| 52 65 6d 6f 76 65 41 6c | 6c 28 29 3b 0d 09 09 0d |RemoveAl|l();....|
|000008e0| 09 09 2f 2f 09 50 6f 73 | 74 3a 09 55 73 65 64 20 |..//.Pos|t:.Used |
|000008f0| 74 6f 20 66 65 74 63 68 | 20 61 6e 79 20 67 69 76 |to fetch| any giv|
|00000900| 65 6e 20 70 74 72 2e 20 | 49 66 20 74 68 65 20 69 |en ptr. |If the i|
|00000910| 6e 64 65 78 20 65 78 69 | 73 74 73 2c 20 3c 74 72 |ndex exi|sts, <tr|
|00000920| 75 65 3e 20 69 73 20 72 | 65 74 75 72 6e 65 64 20 |ue> is r|eturned |
|00000930| 61 6e 64 20 74 68 65 20 | 70 74 72 20 69 73 20 63 |and the |ptr is c|
|00000940| 6f 70 69 65 64 20 74 6f | 20 2a 69 6e 50 74 72 44 |opied to| *inPtrD|
|00000950| 65 73 74 2e 0d 09 09 2f | 2f 09 4e 6f 74 65 3a 09 |est..../|/.Note:.|
|00000960| 4f 6e 65 20 62 61 73 65 | 64 20 69 6e 64 65 78 69 |One base|d indexi|
|00000970| 6e 67 20 69 73 20 75 73 | 65 64 0d 09 09 2f 2f 09 |ng is us|ed...//.|
|00000980| 4f 72 64 65 72 3a 09 4f | 28 20 31 20 29 0d 09 09 |Order:.O|( 1 )...|
|00000990| 76 6f 69 64 2a 09 09 09 | 09 09 46 65 74 63 68 28 |void*...|..Fetch(|
|000009a0| 20 6c 6f 6e 67 20 69 6e | 49 6e 64 65 78 20 29 20 | long in|Index ) |
|000009b0| 63 6f 6e 73 74 3b 0d 09 | 09 62 6f 6f 6c 09 09 09 |const;..|.bool...|
|000009c0| 09 09 46 65 74 63 68 28 | 20 6c 6f 6e 67 20 69 6e |..Fetch(| long in|
|000009d0| 49 6e 64 65 78 2c 20 76 | 6f 69 64 2a 2a 20 69 6f |Index, v|oid** io|
|000009e0| 50 74 72 44 65 73 74 20 | 29 20 63 6f 6e 73 74 3b |PtrDest |) const;|
|000009f0| 20 0d 09 09 69 6e 6c 69 | 6e 65 20 62 6f 6f 6c 09 | ...inli|ne bool.|
|00000a00| 09 09 09 46 65 74 63 68 | 4c 61 73 74 28 20 76 6f |...Fetch|Last( vo|
|00000a10| 69 64 2a 2a 20 69 6f 50 | 74 72 44 65 73 74 20 29 |id** ioP|trDest )|
|00000a20| 20 63 6f 6e 73 74 09 09 | 09 09 09 09 09 09 09 7b | const..|.......{|
|00000a30| 20 72 65 74 75 72 6e 20 | 46 65 74 63 68 28 20 43 | return |Fetch( C|
|00000a40| 6f 75 6e 74 28 29 2c 20 | 69 6f 50 74 72 44 65 73 |ount(), |ioPtrDes|
|00000a50| 74 20 29 3b 09 09 09 7d | 0d 0d 09 09 2f 2f 20 09 |t );...}|....// .|
|00000a60| 41 6c 6c 6f 77 73 20 65 | 61 73 79 20 64 79 6e 61 |Allows e|asy dyna|
|00000a70| 6d 69 63 20 61 72 72 61 | 79 20 75 73 61 67 65 2e |mic arra|y usage.|
|00000a80| 20 20 53 69 6d 70 6c 65 | 20 75 73 65 20 61 6e 79 | Simple| use any|
|00000a90| 20 69 6e 64 65 78 20 61 | 6e 64 20 58 50 74 72 4c | index a|nd XPtrL|
|00000aa0| 69 73 74 20 77 69 6c 6c | 20 65 78 70 61 6e 64 20 |ist will| expand |
|00000ab0| 74 6f 20 6d 65 65 74 20 | 74 68 61 74 20 73 69 7a |to meet |that siz|
|00000ac0| 65 2e 0d 09 09 2f 2f 09 | 49 6d 70 74 3a 09 5a 65 |e....//.|Impt:.Ze|
|00000ad0| 72 6f 20 62 61 73 65 64 | 20 69 6e 64 65 78 69 6e |ro based| indexin|
|00000ae0| 67 20 69 73 20 75 73 65 | 64 20 68 65 72 65 21 21 |g is use|d here!!|
|00000af0| 20 28 49 6e 20 63 6f 6e | 74 72 61 73 74 20 74 6f | (In con|trast to|
|00000b00| 20 46 65 74 63 68 28 29 | 29 0d 09 09 2f 2f 09 4e | Fetch()|)...//.N|
|00000b10| 6f 74 65 3a 09 45 6c 65 | 6d 65 6e 74 73 20 74 68 |ote:.Ele|ments th|
|00000b20| 61 74 20 61 72 65 20 6e | 65 77 6c 79 20 61 63 63 |at are n|ewly acc|
|00000b30| 65 73 73 65 64 20 61 72 | 65 20 69 6e 69 74 69 61 |essed ar|e initia|
|00000b40| 6c 69 7a 65 64 20 74 6f | 20 4e 55 4c 4c 0d 09 09 |lized to| NULL...|
|00000b50| 2f 2f 09 4e 6f 74 65 3a | 09 49 6e 64 65 78 73 20 |//.Note:|.Indexs |
|00000b60| 62 65 6c 6f 77 20 30 20 | 6c 65 61 64 20 74 6f 20 |below 0 |lead to |
|00000b70| 73 44 75 6d 6d 79 3b 0d | 09 09 2f 2f 09 4e 6f 74 |sDummy;.|..//.Not|
|00000b80| 65 3a 09 53 69 6e 63 65 | 20 63 61 6c 6c 65 72 20 |e:.Since| caller |
|00000b90| 68 61 73 20 61 63 63 65 | 73 73 20 74 6f 20 63 68 |has acce|ss to ch|
|00000ba0| 61 6e 67 65 73 20 76 61 | 6c 75 65 73 2c 20 61 6e |anges va|lues, an|
|00000bb0| 79 20 63 75 72 72 65 6e | 74 20 73 6f 72 74 69 6e |y curren|t sortin|
|00000bc0| 67 20 66 63 6e 20 69 73 | 20 6e 6f 74 20 75 73 65 |g fcn is| not use|
|00000bd0| 64 0d 09 09 76 6f 69 64 | 2a 26 09 09 09 09 09 6f |d...void|*&.....o|
|00000be0| 70 65 72 61 74 6f 72 5b | 5d 20 28 20 63 6f 6e 73 |perator[|] ( cons|
|00000bf0| 74 20 6c 6f 6e 67 20 69 | 6e 49 6e 64 65 78 20 29 |t long i|nIndex )|
|00000c00| 3b 09 09 09 0d 09 09 0d | 09 09 2f 2f 09 50 6f 73 |;.......|..//.Pos|
|00000c10| 74 3a 09 4d 6f 76 65 73 | 20 65 6c 65 6d 65 6e 74 |t:.Moves| element|
|00000c20| 20 61 74 20 3c 69 6e 49 | 6e 64 65 78 3e 20 73 6f | at <inI|ndex> so|
|00000c30| 20 74 68 61 74 20 69 74 | 20 68 61 73 20 69 6e 64 | that it| has ind|
|00000c40| 65 78 20 31 2e 0d 09 09 | 76 6f 69 64 09 09 09 09 |ex 1....|void....|
|00000c50| 09 4d 6f 76 65 54 6f 48 | 65 61 64 28 20 6c 6f 6e |.MoveToH|ead( lon|
|00000c60| 67 20 69 6e 49 6e 64 65 | 78 20 29 3b 0d 09 09 0d |g inInde|x );....|
|00000c70| 09 09 2f 2f 09 50 6f 73 | 74 3a 09 53 65 61 72 63 |..//.Pos|t:.Searc|
|00000c80| 68 65 73 20 66 6f 72 20 | 74 68 65 20 67 69 76 65 |hes for |the give|
|00000c90| 6e 20 70 74 72 20 69 6e | 20 69 74 73 20 70 74 72 |n ptr in| its ptr|
|00000ca0| 20 6c 69 73 74 20 61 6e | 64 20 72 65 74 75 72 6e | list an|d return|
|00000cb0| 73 20 74 68 65 20 69 6e | 64 65 78 20 6f 66 20 74 |s the in|dex of t|
|00000cc0| 68 65 20 6d 61 74 63 68 | 0d 09 09 2f 2f 09 09 09 |he match|...//...|
|00000cd0| 49 66 20 74 68 65 20 69 | 74 65 6d 20 63 61 6e 6e |If the i|tem cann|
|00000ce0| 6f 74 20 62 65 20 66 6f | 75 6e 64 2c 20 30 20 69 |ot be fo|und, 0 i|
|00000cf0| 73 20 72 65 74 75 72 6e | 65 64 0d 09 09 2f 2f 09 |s return|ed...//.|
|00000d00| 4e 6f 74 65 3a 09 4f 6e | 65 20 62 61 73 65 64 20 |Note:.On|e based |
|00000d10| 69 6e 64 65 78 69 6e 67 | 20 69 73 20 75 73 65 64 |indexing| is used|
|00000d20| 0d 09 09 2f 2f 09 4f 72 | 64 65 72 3a 09 4f 28 20 |...//.Or|der:.O( |
|00000d30| 4e 20 29 2c 20 4f 28 20 | 6c 6f 67 20 6e 20 29 20 |N ), O( |log n ) |
|00000d40| 69 66 20 73 6f 72 74 69 | 6e 67 20 69 73 20 6f 6e |if sorti|ng is on|
|00000d50| 2e 0d 09 09 6c 6f 6e 67 | 09 09 09 09 09 46 69 6e |....long|.....Fin|
|00000d60| 64 49 6e 64 65 78 4f 66 | 28 20 63 6f 6e 73 74 20 |dIndexOf|( const |
|00000d70| 76 6f 69 64 2a 20 69 6e | 4d 61 74 63 68 50 74 72 |void* in|MatchPtr|
|00000d80| 20 29 20 63 6f 6e 73 74 | 3b 0d 09 09 0d 09 09 2f | ) const|;....../|
|00000d90| 2f 09 50 6f 73 74 3a 09 | 52 65 74 75 72 6e 73 20 |/.Post:.|Returns |
|00000da0| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 69 74 |the numb|er of it|
|00000db0| 65 6d 73 20 69 6e 20 74 | 68 69 73 20 6c 69 73 74 |ems in t|his list|
|00000dc0| 2e 0d 09 09 2f 2f 09 4f | 72 64 65 72 3a 09 4f 28 |....//.O|rder:.O(|
|00000dd0| 20 31 20 29 0d 09 09 69 | 6e 6c 69 6e 65 20 6c 6f | 1 )...i|nline lo|
|00000de0| 6e 67 09 09 09 09 43 6f | 75 6e 74 28 29 20 63 6f |ng....Co|unt() co|
|00000df0| 6e 73 74 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |nst.....|........|
|00000e00| 09 7b 20 72 65 74 75 72 | 6e 20 6c 65 6e 67 74 68 |.{ retur|n length|
|00000e10| 28 29 20 2f 20 34 3b 09 | 09 7d 0d 09 09 0d 09 09 |() / 4;.|.}......|
|00000e20| 2f 2f 09 50 6f 73 74 3a | 09 41 6c 6c 20 70 74 72 |//.Post:|.All ptr|
|00000e30| 73 20 69 6e 20 74 68 69 | 73 20 6c 69 73 74 20 61 |s in thi|s list a|
|00000e40| 72 65 20 72 61 6e 64 6f | 6d 6c 79 20 72 65 6f 72 |re rando|mly reor|
|00000e50| 64 65 72 65 64 2e 0d 09 | 09 76 6f 69 64 09 09 09 |dered...|.void...|
|00000e60| 09 09 52 61 6e 64 6f 6d | 69 7a 65 28 29 3b 0d 09 |..Random|ize();..|
|00000e70| 09 09 0d 09 09 2f 2f 09 | 41 6c 6c 6f 77 73 20 74 |.....//.|Allows t|
|00000e80| 68 65 20 63 6f 6d 70 61 | 72 65 20 66 63 6e 20 74 |he compa|re fcn t|
|00000e90| 6f 20 62 65 20 73 65 74 | 2e 20 20 43 61 75 73 65 |o be set|. Cause|
|00000ea0| 73 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 63 6f |s the cu|rrent co|
|00000eb0| 6e 74 65 6e 74 73 20 74 | 6f 20 62 65 20 72 65 6d |ntents t|o be rem|
|00000ec0| 6f 76 65 64 2e 0d 09 09 | 76 6f 69 64 09 09 09 09 |oved....|void....|
|00000ed0| 09 53 65 74 43 6f 6d 70 | 46 63 6e 28 20 43 6f 6d |.SetComp|Fcn( Com|
|00000ee0| 70 46 75 6e 63 74 69 6f | 6e 54 20 69 6e 46 63 6e |pFunctio|nT inFcn|
|00000ef0| 2c 20 62 6f 6f 6c 20 69 | 6e 53 6f 72 74 4c 6f 77 |, bool i|nSortLow|
|00000f00| 54 6f 48 69 67 68 20 29 | 3b 0d 09 09 0d 09 70 72 |ToHigh )|;.....pr|
|00000f10| 6f 74 65 63 74 65 64 3a | 0d 0d 09 09 0d 09 09 4c |otected:|.......L|
|00000f20| 69 73 74 4f 72 64 65 72 | 69 6e 67 54 09 09 09 6d |istOrder|ingT...m|
|00000f30| 4f 72 64 65 72 69 6e 67 | 3b 0d 09 09 43 6f 6d 70 |Ordering|;...Comp|
|00000f40| 46 75 6e 63 74 69 6f 6e | 54 09 09 09 6d 43 6f 6d |Function|T...mCom|
|00000f50| 70 46 63 6e 3b 0d 09 09 | 0d 09 09 2f 2f 09 50 72 |pFcn;...|...//.Pr|
|00000f60| 65 3a 09 54 68 65 20 6c | 69 73 74 20 6f 66 20 6e |e:.The l|ist of n|
|00000f70| 75 6d 73 20 6d 75 73 74 | 20 62 65 20 73 6f 72 74 |ums must| be sort|
|00000f80| 65 64 0d 09 09 2f 2f 09 | 50 6f 73 74 3a 09 52 65 |ed...//.|Post:.Re|
|00000f90| 74 75 72 6e 73 20 74 68 | 65 20 28 6f 6e 65 20 62 |turns th|e (one b|
|00000fa0| 61 73 65 64 29 20 69 6e | 64 65 78 20 6f 66 20 74 |ased) in|dex of t|
|00000fb0| 68 65 20 70 72 65 64 69 | 63 65 73 73 6f 72 20 6f |he predi|cessor o|
|00000fc0| 66 20 3c 69 6e 4e 75 6d | 3e 2e 20 20 49 66 20 7a |f <inNum|>. If z|
|00000fd0| 65 72 6f 20 69 73 20 72 | 65 74 75 72 6e 65 64 2c |ero is r|eturned,|
|00000fe0| 0d 09 09 2f 2f 09 09 09 | 74 68 65 6e 20 3c 69 6e |...//...|then <in|
|00000ff0| 4e 75 6d 3e 20 69 73 20 | 3c 3d 20 74 68 61 6e 20 |Num> is |<= than |
|00001000| 61 6c 6c 20 74 68 65 20 | 65 6c 65 6d 65 6e 74 73 |all the |elements|
|00001010| 20 69 6e 20 74 68 65 20 | 6c 69 73 74 2e 0d 09 09 | in the |list....|
|00001020| 6c 6f 6e 67 09 09 09 09 | 09 46 65 74 63 68 50 72 |long....|.FetchPr|
|00001030| 65 64 49 6e 64 65 78 28 | 20 63 6f 6e 73 74 20 76 |edIndex(| const v|
|00001040| 6f 69 64 2a 20 69 6e 4e | 75 6d 20 29 20 63 6f 6e |oid* inN|um ) con|
|00001050| 73 74 3b 0d 09 09 0d 09 | 09 73 74 61 74 69 63 20 |st;.....|.static |
|00001060| 76 6f 69 64 2a 09 09 09 | 73 44 75 6d 6d 79 3b 0d |void*...|sDummy;.|
|00001070| 0d 7d 3b 0d 0d 0d 0d 0d | 0d 23 65 6e 64 69 66 00 |.};.....|.#endif.|
|00001080| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00001090| 85 c0 01 00 00 a7 82 fc | 83 e5 84 59 01 00 00 00 |........|...Y....|
|000010a0| 00 8a 6b 00 00 00 16 89 | 28 c0 01 00 00 a7 83 eb |..k.....|(.......|
|000010b0| 0a 58 50 74 72 4c 69 73 | 74 2e 68 33 20 44 65 76 |.XPtrLis|t.h3 Dev|
|000010c0| 65 66 73 6d 70 33 2e 6d | 70 33 77 6f 72 6c 64 2e |efsmp3.m|p3world.|
|000010d0| 02 00 54 45 58 54 43 57 | 49 45 01 00 ff ff ff ff |..TEXTCW|IE......|
|000010e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010f0| 00 00 ae 2f 7a c6 00 00 | 0c 9a 00 00 01 9a 00 00 |.../z...|........|
|00001100| 00 8a 6f 00 00 00 16 82 | 3d c0 01 00 00 a7 80 c1 |..o.....|=.......|
|00001110| 80 f4 85 47 01 00 00 00 | 00 8a 70 00 00 00 16 80 |...G....|..p.....|
|00001120| d3 c0 01 00 00 a7 87 5b | 87 bc 88 50 01 00 00 00 |.......[|...P....|
|00001130| 00 8a 71 00 00 00 16 83 | 25 c0 01 00 00 a7 85 f9 |..q.....|%.......|
|00001140| 86 41 88 48 01 00 00 00 | 00 8a 72 00 00 00 16 89 |.A.H....|..r.....|
|00001150| 6a c0 01 00 00 a7 87 0c | 87 58 87 f2 01 00 00 00 |j.......|.X......|
|00001160| 00 8a 73 00 00 00 16 88 | 69 c0 01 00 00 a7 86 d5 |..s.....|i.......|
|00001170| 87 07 85 95 01 00 00 00 | 00 8a 74 00 00 00 16 88 |........|..t.....|
|00001180| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00001190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011a0| 00 00 00 00 00 00 00 03 | 00 04 00 6b 00 3c 02 3a |........|...k.<.:|
|000011b0| 02 9c 00 6b 00 3c 02 3a | 02 9c b3 7e e2 12 00 00 |...k.<.:|...~....|
|000011c0| 01 55 00 00 01 67 00 00 | 00 00 01 00 00 00 00 04 |.U...g..|........|
|000011d0| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|000011e0| 00 00 00 46 04 fd f0 cc | 15 4e 00 00 00 1c 00 46 |...F....|.N.....F|
|000011f0| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00001200| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00001210| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|00001220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+